package com.yanjun.progress

import android.app.Service
import android.content.Intent
import android.os.Binder
import android.os.IBinder
import android.util.Log

class GyscropeService : Service() {
    var book = Acceleration()

    private var binder: Binder = object : IGyroscopeInfoInterface.Stub() {
        override fun getx(): Double {
           return book.x
        }

        override fun setX(x: Double) {
            book.x = x
        }


        override fun getAcceleration(): Acceleration {

            book.x = getx().toDouble()
            return book
        }

        override fun setAcceleration(book: Acceleration?) {

        }


    }

    override fun onBind(intent: Intent): IBinder ?{
        return binder
    }

    override fun onCreate() {
        super.onCreate()
    }
}